home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / ultqsrc.zip / CMDLIB.H < prev    next >
C/C++ Source or Header  |  1996-07-25  |  2KB  |  80 lines

  1. // cmdlib.h
  2.  
  3. #ifndef __CMDLIB__
  4. #define __CMDLIB__
  5.  
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <errno.h>
  10. #include <ctype.h>
  11. #include <sys/types.h>
  12. #include <sys/stat.h>
  13. #include <sys/file.h>
  14. #include <stdarg.h>
  15.  
  16. #ifdef NeXT
  17. #include <libc.h>
  18. #endif
  19.  
  20. #ifndef __BYTEBOOL__
  21. #define __BYTEBOOL__
  22. typedef enum {false, true} boolean;
  23. typedef unsigned char byte;
  24. #endif
  25.  
  26. // the dec offsetof macro doesn't work very well...
  27. #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
  28.  
  29.  
  30. // set these before calling CheckParm
  31. extern int myargc;
  32. extern char **myargv;
  33.  
  34. char *strupr (char *in);
  35. char *strlower (char *in);
  36. int filelength (int handle);
  37. int tell (int handle);
  38.  
  39. double I_FloatTime (void);
  40.  
  41. void    Error (char *error, ...);
  42. int        CheckParm (char *check);
  43.  
  44. int     SafeOpenWrite (char *filename);
  45. int     SafeOpenRead (char *filename);
  46. void     SafeRead (int handle, void *buffer, long count);
  47. void     SafeWrite (int handle, void *buffer, long count);
  48. void     *SafeMalloc (long size);
  49.  
  50. long    LoadFile (char *filename, void **bufferptr);
  51. void    SaveFile (char *filename, void *buffer, long count);
  52.  
  53. void     DefaultExtension (char *path, char *extension);
  54. void     DefaultPath (char *path, char *basepath);
  55. void     StripFilename (char *path);
  56. void     StripExtension (char *path);
  57.  
  58. void     ExtractFilePath (char *path, char *dest);
  59. void     ExtractFileBase (char *path, char *dest);
  60. void    ExtractFileExtension (char *path, char *dest);
  61.  
  62. long     ParseNum (char *str);
  63.  
  64. short    BigShort (short l);
  65. short    LittleShort (short l);
  66. long    BigLong (long l);
  67. long    LittleLong (long l);
  68. float    BigFloat (float l);
  69. float    LittleFloat (float l);
  70.  
  71.  
  72. char *COM_Parse (char *data);
  73.  
  74. extern    char    com_token[1024];
  75. extern    int        com_eof;
  76.  
  77.  
  78.  
  79. #endif
  80.